package com.zdzx.model.service.content.result;

import java.io.Serializable;
import java.time.LocalDateTime;

import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "课程列表", description = "课程列表")
public class CourseList implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "id", name = "id")
	private String id;
	
	@ApiModelProperty(value = "视频标题", name = "title")
	private String title;
	
	@ApiModelProperty(value = "标题图片", name = "dataImage")
	private String titleImage;
	
	@ApiModelProperty(value = "视频图片", name = "dataImage")
	private String dataImage;
	
	@ApiModelProperty(value = "讲师", name = "lecturer")
	private String lecturer;
	@ApiModelProperty(value = "价格", name = "price")
	private String price;
	
	@ApiModelProperty(value = "1 免费 0收费", name = "free")
	private String free;
	
	private String type;
	private String path;
	private int views;
	
	@JsonDeserialize(using = LocalDateTimeDeserializer.class)
	@JsonSerialize(using = LocalDateTimeSerializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ApiModelProperty(value = "创建时间", name = "createTime",example = "2019-09-09 00:00:00")
	private LocalDateTime createTime;
	
	@JsonDeserialize(using = LocalDateTimeDeserializer.class)
	@JsonSerialize(using = LocalDateTimeSerializer.class)
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ApiModelProperty(value = "修改时间", name = "updateTime",example = "2019-09-09 00:00:00")
	private LocalDateTime updateTime;
	/*
	public void setTitleImage(String titleImage) {
		if(!StringUtils.isEmpty(titleImage)&&!titleImage.contains(SystemConfig.ossIp))
		this.titleImage = SystemConfig.ossIp+titleImage;
		else
		this.titleImage = titleImage;
	}
	
	public void setDataImage(String dataImage) {
		if(!StringUtils.isEmpty(dataImage)&&!dataImage.contains(SystemConfig.ossIp))
		this.dataImage = SystemConfig.ossIp+dataImage;
		else
		this.dataImage=dataImage;
	}
	*/
	
}
